package com.njtoyo.taxi.admin.mapper.master.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.DriverMoneyDeducting;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njtoyo.taxi.admin.rest.presenter.business.driver.MoneyDeductingPresenter;
import com.njtoyo.taxi.admin.rest.wrapper.business.driver.MoneyDeductingQueryWrapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

/**
 * <p>
 * 司机扣款表 Mapper 接口
 * </p>
 *
 * @author Dell
 * @since 2021-11-01
 */
@Repository
@DS(Const.PRIMARY_DS)
public interface DriverMoneyDeductingMapper extends BaseMapper<DriverMoneyDeducting> {
    BigDecimal computeDriverBalance(Long driverId);

    Page<MoneyDeductingPresenter> getMoneyDeductingList(MoneyDeductingQueryWrapper wrapper);

    MoneyDeductingPresenter getMoneyDeducting(Long id);

    BigDecimal selectDriverFundsOut(@Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);


}
